Skip to content

feat:Add opt‑in navigation handler for external URLs#5531

Merged
jkelleyrtp merged 4 commits intoDioxusLabs:mainfrom
trane-project:main
May 7, 2026
Merged

feat:Add opt‑in navigation handler for external URLs#5531
jkelleyrtp merged 4 commits intoDioxusLabs:mainfrom
trane-project:main

Conversation

@martinmr
Copy link
Copy Markdown
Contributor

@martinmr martinmr commented May 6, 2026

Pretty much the same as #5231, which was closed without comment.

Without this change, iframes will open in an external browser, breaking existing apps and disallowing many legitimate uses like embedding a YouTube video, etc.

One change was made after discussing it with @jkelleyrtp, which was to make all URLs navigable by default when the handler is not set. That way, only users which need finer control over this have to set the handler.

not-a-cowfr and others added 2 commits May 5, 2026 16:41
The branches should be reorder so that the branch that checks for
the index and assets is always taken first. Otherwise, they will
fail to load for users who forget to allow them in their custom
handlers, which will be a crappy experience and hard to debug.
@martinmr martinmr requested a review from a team as a code owner May 6, 2026 21:18
@martinmr
Copy link
Copy Markdown
Contributor Author

martinmr commented May 6, 2026

I have tested this in a local app and works as expected.

@jkelleyrtp jkelleyrtp merged commit 552070d into DioxusLabs:main May 7, 2026
21 checks passed
jkelleyrtp added a commit that referenced this pull request May 7, 2026
* feat:Add opt‑in navigation handler for external URLs (#5531)

* add navigation handler config option

code from #5231

* Re-order branches

The branches should be reorder so that the branch that checks for
the index and assets is always taken first. Otherwise, they will
fail to load for users who forget to allow them in their custom
handlers, which will be a crappy experience and hard to debug.

* remove return

* Change behavior when handler not set

---------

Co-authored-by: not a cow <agielow@proton.me>

* fix: allow navigations but disallow external nav

---------

Co-authored-by: Martin Martinez Rivera <mrtnz.rvr@gmail.com>
Co-authored-by: not a cow <agielow@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants